#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
using namespace std;

const int N = 1e6 + 10;

int main()
{
    long long x;
    cin >> x;

    int ans = 1e6 + 20;
    int p = 0;
    for (int i = 0; i <= N; i++)
    {
        long long y = i * i;
        double k = abs(x - y);
        if (ans > k)
        {
            ans = k;
            p = y;
        }
    }
    cout << p << '\n';

    return 0;
}